<form action="index.php" method="post" name="adminForm">
	<table class="adminlist">
		<thead>
			<tr>
				<th width="20">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->divisions); ?>);" />
				</th>
				<th class="title">Name</th>
				<th width="45%">Parent Division</th>
			</tr>
		</thead>	
		<?php
			jimport('joomla.filter.output');
			$k = 0;
			$n = count($this->divisions);			
			for ($i=0; $i < $n; $i++)
			{
				$division = &$this->divisions[$i];
				$checked = JHTML::_('grid.id', $i, $division->division_id );
				$link = 'index.php?option=' . $option . '&task=edit&c=division&cid[]='. $division->division_id;
				$link2 = 'index.php?option=' . $option . '&task=edit&c=division&cid[]='. $division->parent_division_id;
		?>
			<tr>
				<td>
					<?php echo $checked; ?>
				</td>
				<td>
					<a href="<?php echo $link; ?>"><?php echo $division->name; ?></a>
				</td>
				<td>
					<? if ($division->parent_division_id): ?>
						<a href="<?php echo $link2; ?>"><?php echo $division->parent_division_name; ?></>
					<? else: ?>
						None
					<? endif; ?>
				</td>
			</tr>
		<?php
				$k = 1 - $k;
			}
		?>
	</table>
	<input type="hidden" name="option" value="<?php echo JRequest::getVar( 'option' );?>"/>
	<input type="hidden" name="c" value="<?php echo JRequest::getVar('c', 'division'); ?>" />
    <input type="hidden" name="task" value=""/>
    <input type="hidden" name="boxchecked" value="0"/>    	
	<input type="hidden" name="hidemainmenu" value="0"/>  
</form>